package com.example.kafka;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;

@SpringBootApplication
public class KafkaApplication {

    public static void main(String[] args) {
        SpringApplication.run(KafkaApplication.class, args);
    }


    @Autowired
    private UserLogProducer userLogProducer;

    @PostConstruct
    public void init() {
        for (int i = 0; i < 10; i++) {
            userLogProducer.sendlog(String.valueOf(i));
        }

    }
}
